# -*- coding: utf-8 -*-
# @Time    : 2023/1/5 9:43 上午
# @Author  : zuokuijun
# @Email   : zuokuijun13@163.com
import os

import matplotlib.pyplot as plt


def plot_multi_airfoil(filePath):
    dir = os.listdir(filePath)
    plt.Figure()
    for i in range(len(dir)):
        x = []
        y = []
        file = os.path.join(filePath, dir[i])
        print("the plot airfoil is {}".format(dir[i]))
        with open(file, "r") as f:
            for line in f.readlines():
                line = line.strip("\n")
                lines = line.split()
                x.append(float(lines[0]))
                y.append(float(lines[1]))
        print(i)
        plt.plot(x, y, lw=1.2)
    plt.show()

if __name__ == '__main__':
    path = "./data/X_Y/"
    plot_multi_airfoil(path)